home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / include / x11 / ximproto.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-11  |  6.7 KB  |  293 lines

  1. /*
  2.  * $XConsortium: XIMproto.h,v 1.4 91/06/05 08:24:13 rws Exp $
  3.  */
  4.  
  5. /*
  6.  * Copyright 1990, 1991 by OMRON Corporation
  7.  * Copyright 1991 by the Massachusetts Institute of Technology
  8.  *
  9.  * Permission to use, copy, modify, distribute, and sell this software and its
  10.  * documentation for any purpose is hereby granted without fee, provided that
  11.  * the above copyright notice appear in all copies and that both that
  12.  * copyright notice and this permission notice appear in supporting
  13.  * documentation, and that the names of OMRON and MIT not be used in
  14.  * advertising or publicity pertaining to distribution of the software without
  15.  * specific, written prior permission.  OMRON and MIT make no representations
  16.  * about the suitability of this software for any purpose.  It is provided
  17.  * "as is" without express or implied warranty.
  18.  *
  19.  * OMRON AND MIT DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  20.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  21.  * EVENT SHALL OMRON OR MIT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  22.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  23.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  24.  * TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  25.  * PERFORMANCE OF THIS SOFTWARE. 
  26.  *
  27.  *    Author:    Seiji Kuwari    OMRON Corporation
  28.  *                kuwa@omron.co.jp
  29.  *                kuwa%omron.co.jp@uunet.uu.net
  30.  */                
  31.  
  32. #ifndef XIMPROTO_H
  33. #define XIMPROTO_H
  34.  
  35. #include <X11/Xmd.h>
  36.  
  37. /*
  38.  * Define constants for the sizes of the network packets.  The sz_ prefix is
  39.  * used instead of something more descriptive so that the symbols are no more
  40.  * than 32 characters in length (which causes problems for some compilers).
  41.  */
  42.  
  43. #define    XIM_MAJOR_VERSION    4
  44. #define    XIM_MINOR_VERSION    0
  45.  
  46. #define    sz_ximRequestHeader    4
  47. #define    sz_ximNormalReply    4
  48.  
  49. #define    sz_ximConnClient    4
  50. #define    sz_ximGetIMReq        8
  51. #define    sz_ximGetIMReply    8
  52. #define sz_ximCreateICReq    4
  53. #define sz_ximCreateICReply    8
  54. #define sz_ximChangeICReq    8
  55. #define sz_ximChangeICReply    sz_ximNormalReply
  56. #define sz_ximGetICReq        12
  57. #define sz_ximGetICReply    sz_ximNormalReply
  58. #define sz_ximICValuesReq    28
  59. #define    sz_ximICAttributesReq    48
  60. #define    sz_ximDestroyICReq    8
  61. #define    sz_ximICFocusReq    8
  62. #define    sz_ximResetICReq    8
  63.  
  64. #define sz_ximEventReq        8
  65. #define sz_ximEventReply    8
  66. #define sz_ximReturnReply    8
  67.  
  68. /* For Callback */
  69. #define sz_ximPreDrawReply    16
  70. #define sz_ximPreCaretReply    8
  71. #define sz_ximStatusDrawReply    12
  72.  
  73. #define    Window    CARD32
  74. #define    Atom    CARD32
  75. #define    Colormap    CARD32
  76. #define    Pixmap    CARD32
  77. #define    Cursor    CARD32
  78.  
  79. typedef struct {    /* 4 */
  80.     CARD8    reqType;
  81.     BYTE    pad;
  82.     CARD16    length B16;
  83. } ximRequestHeader;
  84.  
  85. typedef struct {    /* 4 */
  86.     CARD16    state B16;
  87.     CARD16    detail B16;
  88. } ximNormalReply;
  89.  
  90. typedef struct {    /* 4 */
  91.     CARD8    byteOrder;
  92.     BYTE    pad;
  93.     CARD16    length B16;
  94. } ximConnClient;
  95.  
  96. typedef struct {    /* 8 */
  97.     CARD8    reqType;
  98.     BYTE    pad;
  99.     CARD16    length B16;
  100.     CARD32    mask B32;
  101. } ximGetIMReq;
  102.  
  103. typedef struct {    /* 8 */
  104.     CARD16    state B16;
  105.     INT16    num_styles B16;
  106.     INT16    nbytes B16;
  107.     CARD16    pad B16;
  108. } ximGetIMReply;
  109.  
  110. typedef struct {    /* 4 */
  111.     CARD8    reqType;
  112.     BYTE    pad;
  113.     CARD16    length B16;
  114. } ximCreateICReq;
  115.  
  116. typedef struct {    /* 8 */
  117.     CARD16    state B16;
  118.     CARD16    detail B16;
  119.     CARD32    xic B32;
  120. } ximCreateICReply;
  121.  
  122. typedef    struct {    /* 8 */
  123.     CARD8    reqType;
  124.     BYTE    pad;
  125.     CARD16    length B16;
  126.     CARD32    xic B32;
  127. } ximChangeICReq;
  128.  
  129. typedef ximNormalReply    ximChangeICReply;
  130.  
  131. typedef struct {    /* 12 */
  132.     CARD8    reqType;
  133.     BYTE    pad;
  134.     CARD16    length B16;
  135.     CARD32    xic B32;
  136.     CARD32    mask B32;
  137. } ximGetICReq;
  138.  
  139. typedef ximNormalReply    ximGetICReply;
  140.  
  141. typedef struct {    /* 28 */
  142.     CARD32    mask B32;
  143.     INT32    input_style B32;
  144.     Window    c_window B32;
  145.     Window    focus_window B32;
  146.     CARD32    filter_events B32;
  147.     INT32    max_keycode B32;
  148.     INT16    nbytes B16;
  149.     INT16    nbytes2 B16;
  150. } ximICValuesReq;
  151.  
  152. typedef struct {    /* 48 */
  153.     INT16    area_x B16, area_y B16;
  154.     CARD16    area_width B16, area_height B16;
  155.     CARD16    areaneeded_width B16, areaneeded_height B16;
  156.     INT16    spot_x B16, spot_y B16;
  157.     Colormap    colormap B32;
  158.     Atom    std_colormap B32;
  159.     CARD32    foreground B32, background B32;
  160.     Pixmap    pixmap B32;
  161.     INT16    line_space B16;
  162.     CARD16    pad1 B16;
  163.     Cursor    cursor B32;
  164.     CARD16    nfonts B16;
  165.     INT16    nbytes B16;
  166. } ximICAttributesReq;
  167.  
  168. typedef    struct {    /* 8 */
  169.     CARD8    reqType;
  170.     BYTE    pad;
  171.     CARD16    length B16;
  172.     CARD32    xic B32;
  173. } ximDestroyICReq;
  174.     
  175. typedef struct {    /* 8 */
  176.     CARD8    reqType;
  177.     BYTE    pad;
  178.     CARD16    length B16;
  179.     CARD32    xic B32;
  180. } ximICFocusReq;
  181.     
  182. typedef    struct {    /* 8 */
  183.     CARD8    reqType;
  184.     BYTE    pad;
  185.     CARD16    length B16;
  186.     CARD32    xic B32;
  187. } ximResetICReq;
  188.  
  189. typedef    struct {    /* 8 */
  190.     CARD8    reqType;
  191.     BYTE    pad;
  192.     CARD16    length B16;
  193.     CARD32    xic B32;
  194. } ximEventReq;
  195.  
  196. typedef struct {    /* 8 */
  197.     CARD16    state B16;
  198.     CARD16    detail B16;
  199.     INT16    number B16;
  200.     CARD16    pad B16;
  201. } ximEventReply;
  202.  
  203. typedef struct {    /* 8 */
  204.     CARD16    type B16;
  205.     INT16    length B16;
  206.     KeySym    keysym B32;
  207. } ximReturnReply;
  208.  
  209. /* For Callback */
  210. typedef struct {    /* 16 */
  211.     INT16    caret B16;
  212.     INT16    chg_first B16;
  213.     INT16    chg_length B16;
  214.     INT16    encoding_is_wchar B16;
  215.     INT16    length B16;
  216.     CARD16    pad B16;
  217.     INT32    feedback B32;
  218. } ximPreDrawReply;
  219.  
  220. typedef struct {    /* 8 */
  221.     INT16    position B16;
  222.     CARD16    direction B16;
  223.     CARD16    style B16;
  224.     CARD16    pad B16;
  225. } ximPreCaretReply;
  226.  
  227. typedef struct {    /* 12 */
  228.     CARD16    type B16;
  229.     INT16    encoding_is_wchar B16;
  230.     INT16    length B16;
  231.     INT16    feedback B16;
  232.     Pixmap    bitmap B32;
  233. } ximStatusDrawReply;
  234.  
  235. #define    XIM_GetIM        1
  236. #define    XIM_CreateIC        2
  237. #define    XIM_ChangeIC        3
  238. #define    XIM_GetIC        4
  239. #define    XIM_DestroyIC        5
  240. #define    XIM_SetICFocus        6
  241. #define    XIM_UnsetICFocus    7
  242. #define    XIM_ResetIC        8
  243. #define    XIM_Event        9
  244.  
  245. #define    XIM_NOTHING        1
  246. #define    XIM_NOFILTER        2
  247. #define    XIM_RETURN        3
  248. #define    XIM_CALLBACK        4
  249. #define    XIM_IC            5
  250. #ifdef    XML
  251. #define XIM_CH_LOCALE        6
  252. #endif    /* XML */
  253.  
  254.  
  255. #define    XIM_STRING        (short)1
  256. #define    XIM_KEYSYM        (short)2
  257.  
  258. /* For Callback */
  259. #define    XIM_CB_PRE_START    1
  260. #define    XIM_CB_PRE_DONE        2
  261. #define    XIM_CB_PRE_DRAW        3
  262. #define    XIM_CB_PRE_CARET    4
  263. #define    XIM_CB_ST_START        5
  264. #define    XIM_CB_ST_DONE        6
  265. #define    XIM_CB_ST_DRAW        7
  266.  
  267. #define    XIM_CB_FW_CHAR        1
  268. #define    XIM_CB_BW_CHAR        2
  269. #define    XIM_CB_FW_WORD        3
  270. #define    XIM_CB_BW_WORD        4
  271. #define    XIM_CB_CARET_UP        5
  272. #define    XIM_CB_CARET_DOWN    6
  273. #define    XIM_CB_NEXT_LINE    7
  274. #define    XIM_CB_PREV_LINE    8
  275. #define    XIM_CB_LINE_START    9
  276. #define    XIM_CB_LINE_END        10
  277. #define    XIM_CB_ABS_POS        11
  278. #define    XIM_CB_DONT_CHANGE    12
  279.  
  280. #define    XIM_ST_TEXT        1
  281. #define    XIM_ST_BITMAP        2
  282.  
  283. #undef    Window
  284. #undef    Atom
  285. #undef    Colormap
  286. #undef    Pixmap
  287. #undef    Cursor    
  288.  
  289. #define _Read(fd, data, size)    read((fd), (data), (size))
  290. #define _Write(fd, data, size)    write((fd), (data), (size))
  291.  
  292. #endif    /* XIMPROTO_H */
  293.